import { _decorator, Component, Node } from 'cc';
import { UIHeader } from '../common/UIHeader';
import { EventManager } from '../event/EventManager';
import { UIManager } from '../common/UIManager';
import { PrefabEnum } from '../common/PrefabEnum';
const { ccclass, property } = _decorator;

@ccclass('CopyIndex')
export class CopyIndex extends Component {

    @property(UIHeader)
    uiHeader:UIHeader
    @property(Node)
    pvp:Node

    start() {
        this.uiHeader.setData('副本')
        EventManager.instance.on('副本close', this.onClose, this)
        this.pvp.on(Node.EventType.TOUCH_END, this.onPvp, this)
    }

    onPvp(){
        UIManager.instance.openUI(PrefabEnum.PVPList)
    }

    onClose(){
        UIManager.instance.closeUI(PrefabEnum.CopyIndex)
    }
}


